﻿using System;

class GetMaxMethod
{
    //Exercise 2.
    //Write a method GetMax() with two parameters that returns the bigger of two integers. 
    //Write a program that reads 3 integers from the console and prints the biggest of them using the method GetMax().

    static void Main()
    {
        Console.WriteLine("Enter 3 integers: ");
        int number1 = int.Parse(Console.ReadLine());
        int number2 = int.Parse(Console.ReadLine());
        int number3 = int.Parse(Console.ReadLine());

        if (number3 > GetMax(number1, number2))
        {
            Console.WriteLine("The biggest number is {0}.", number3);
        }
        else
        {
            Console.WriteLine("The biggest number is {0}.", GetMax(number1, number2));
        }
    }

    static int GetMax(int numOne, int numTwo)
    {
        int maxNumber = numTwo;
        if (numOne > numTwo)
        {
            return maxNumber = numOne;            
        }             
        return maxNumber;
    }

}

